package kaka.controls
{
	import com.greensock.TweenLite;
	import com.greensock.plugins.MotionBlurPlugin;
	import com.greensock.plugins.TweenPlugin;
	
	import kaka.controls.datagrid.SuperDataGridColumn;
	
	import mx.containers.Canvas;
	import mx.controls.Text;
	import mx.core.IToolTip;
	import mx.events.FlexEvent;
	
	public class TooltipsPlus extends Canvas implements IToolTip
	{
		//提示内容框
		private var txt:Text;
		//提示内容
		private var _txtContent:String;
		private var _toolTipWidth:Number;
		public function TooltipsPlus()
		{
			super();
		}
		override protected function createChildren():void
		{
			super.createChildren();
			txt=new Text();
			addChild(txt);
		}
		override protected function commitProperties():void
		{
			super.commitProperties();
			txt.width=_toolTipWidth;
			this.width=_toolTipWidth;
			txt.text=_txtContent;
			txt.selectable=false;
		}
//		override protected function measure():void
//		{
//			txt.measuredWidth=200;
//			this.measuredWidth=200;
//		}
		override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
		{
			super.updateDisplayList(unscaledWidth,unscaledHeight);
			this.graphics.beginFill(0xFFFFFF,0.3);
			this.graphics.drawRect(0,0,this.width,this.height);
			this.graphics.endFill();
		}
		
		public function get txtContent():String
		{
			return _txtContent;
		}

		public function set txtContent(value:String):void
		{
			_txtContent = value;  
			invalidateProperties(); 
			invalidateSize();
		}
		public function get text():String
		{
			return "";
		}
		public function set text(value:String):void
		{
			
		}

		public function get toolTipWidth():Number
		{
			return _toolTipWidth;
		}

		public function set toolTipWidth(value:Number):void
		{
			_toolTipWidth = value;
			invalidateProperties();
			invalidateSize();
		}


	}
}